<template>
	<view>
		<navigator url="../Code_Across_the/Code_Across_the">
			<button>跳转到普通页面</button>
		</navigator>
		<navigator url="../contact/contact" open-type="switchTab">
			<button>跳转到tabbar页面</button>
		</navigator>
		<button type="primary" @click="navTo()">使用navigatorTo进行跳转</button>
		<button type="default" @click="toSwitchTab()">使用switchTab跳转</button>
		<button type="default" @click="redirectTo()">使用redirectTo跳转</button>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				list:[{
					name:'张三',
					age:18
				}]
			}
		},
		methods: {
			navTo(){
				uni.navigateTo({
					url:`../Code_Across_the/Code_Across_the?id=80`
				})
			},
			toSwitchTab(){
				uni.switchTab({//只能跳转到tabbar页面
					url:"../contact/contact"
				})
			},
			redirectTo(){
				uni.redirectTo({
					url:'../Code_Across_the/Code_Across_the'
				})
			} 
			
		},
		onUnload(){
			console.log('页面卸载了');
		}
	}
</script>

<style>

</style>
